package ee.serge.client.content;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.RootPanel;

import ee.serge.client.AlertBox;
import ee.serge.client.Move;
import ee.serge.util.AdminSubMenu;
import ee.serge.util.Loader;
import ee.serge.util.MainHeader;
import ee.serge.util.URLData;

public class StartPoint implements EntryPoint {
   
   @Override
   public void onModuleLoad() {
      Loader.show();
      AdminSubMenu.get();
      RootPanel.get("mainmenu").add(MainHeader.get());
      RootPanel.get("alert").add(new AlertBox());
      String hash = Window.Location.getHash();
      if (hash.length() == 0) {
      	CalculatorContent.show();
      } else {
      	URLData data;
      	data = new URLData(Window.Location.getHash().substring(1));
      	GWT.log("name:" + data.getName());
         Move.get().goToContent(data);
      }
      
   }

}
